package com.whatisjee.ssf.domain.entity;

import static javax.persistence.GenerationType.IDENTITY;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;

@Entity
@Table(name = "log_info")
public class Log implements Serializable {
	private static final long serialVersionUID = 7144865596101158140L;
	
	private Integer id;
	private Date loggedAt;
	private String username;
	private String terminal;
	private Short severity;
	private String summary;
	private Serializable args;
	private String detail;

	public Log() {
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "logged_at", nullable = false, length = 19)
	public Date getLoggedAt() {
		return loggedAt;
	}

	public void setLoggedAt(Date loggedAt) {
		this.loggedAt = loggedAt;
	}

	@Size(max = 50)
	@Column(name = "user_name", nullable = false, length = 50)
	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Size(max = 50)
	@Column(name = "terminal", nullable = false, length = 50)
	public String getTerminal() {
		return terminal;
	}

	public void setTerminal(String terminal) {
		this.terminal = terminal;
	}

	@Column(name = "severity", nullable = false)
	public Short getSeverity() {
		return severity;
	}

	public void setSeverity(Short severity) {
		this.severity = severity;
	}

	@Size(max = 2000)
	@Column(name = "summary", nullable = false, length = 2000)
	public String getSummary() {
		return summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}
	
	@Column(name = "args")
	public Serializable getArgs() {
		return args;
	}

	public void setArgs(Serializable args) {
		this.args = args;
	}

	@Column(name = "detail")
	public String getDetail() {
		return detail;
	}

	public void setDetail(String detail) {
		this.detail = detail;
	}

}
